package org.boulderfoodrescue.webapp.client.old.calendar.ical;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Widget;

public class RepeatNewEventPanel extends Composite {
  
  /*
   * RepeatNewEventPanel creates another sub-menu that allows the user to 
   * repeat the event weekly, daily, etc.
   */
  
  private static RepeatNewEventPanelUiBinder uiBinder = GWT
      .create(RepeatNewEventPanelUiBinder.class);
  
  interface RepeatNewEventPanelUiBinder extends UiBinder<Widget, RepeatNewEventPanel> {
  }
  
  protected DialogBox dlg;
  public RepeatNewEventPanel(DialogBox dlg) {
    this.dlg = dlg;
    initWidget(uiBinder.createAndBindUi(this));
  }
  
  @UiHandler("button_repeat_event")
  public void onButtonSave(ClickEvent e){
    /*
    if(!warned && !DataManager.getLoginInfo().isLoggedIn()){
      Window.alert("Data will be lost if you are not logged in when you leave this website. We suggest that you login first by clicking \"sign in\"in the top right corner of the webpage");
      warned = true;
      */
      dlg.hide();
    //}
    /*
    String name = input_name.getText();
    if(name.length() == 0){
      Window.alert("Name field cannot be empty");
      return;
    }*/
    
  }

  @UiHandler("button_cancel_repeat")
  public void onButtonCancel(ClickEvent e){
    dlg.hide();
  }
}
